var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
    })(e, t);
}, function(e, t) {
    function n() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, 
    new n());
}), a = this && this.__decorate || function(e, t, n, a) {
    var o, r = arguments.length, c = r < 3 ? t : null === a ? a = Object.getOwnPropertyDescriptor(t, n) : a;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) c = Reflect.decorate(e, t, n, a); else for (var u = e.length - 1; 0 <= u; u--) (o = e[u]) && (c = (r < 3 ? o(c) : 3 < r ? o(t, n, c) : o(t, n)) || c);
    return 3 < r && c && Object.defineProperty(t, n, c), c;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("GameConfig"), s = e("GameData"), c = e("AudioManager"), l = e("DrawManager"), d = e("OlympicManager"), u = e("UIManager"), p = e("Global"), h = cc._decorator, f = h.ccclass, g = h.property, m = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.warn = null, e.num = 100, e;
    }
    return i(e, t), e.prototype.onClick = function() {
        var e;
        c.default.getInstance().playAudio("按钮2"), s.GD.piece < this.num ? s.GD.pieceCount < r.GC.maxPieceCount && p.G.platform != p.Platform.XiaoDu ? u.default.getInstance().loadPopPnl("piece", {
            num: r.GC.pieceNum,
            view: this
        }) : u.default.getInstance().showToast({
            str: "今日获取碎片次数已达上限"
        }) : (s.GD.olympicDrawTotal++, s.GD.updateNumber("piece", -this.num), PD.data = l.default.getInstance().doDraw(d.default.getInstance().getDraw()), 
        u.default.getInstance().barViews.forEach(function(e) {
            return e.refresh();
        }), PD.data.type != p.RewardType.SKIN && PD.data.type != p.RewardType.ARM || (e = u.default.getInstance().getPnl("start")) && e.personView.init(), 
        p.G.queue.splice(0, 0, {
            name: "olympicOpen",
            type: 1,
            data: {}
        }), 0 < p.G.queue.length && (1 == (e = p.G.queue.shift()).type ? u.default.getInstance().loadPnl(e.name) : 2 == e.type && u.default.getInstance().loadPopPnl(e.name, e.data)));
    }, e.prototype.onLoad = function() {
        u.default.getInstance().barViews.push(this);
    }, e.prototype.start = function() {
        this.refresh();
    }, e.prototype.refresh = function() {
        s.GD.piece < 100 ? this.warn.active = !1 : this.warn.active = !0;
    }, a([ g(cc.Node) ], e.prototype, "warn", void 0), a([ f ], e);
}(cc.Component);

n.default = m;